from flask import Flask, render_template
from flask import request
from dbHelper import DBHelper

# app=Flask(__name__)
app = Flask(__name__, template_folder='template')
db=DBHelper()
@app.route("/")
def index():
    return render_template("argsDemo.html")

@app.route("/proDetail")
def show():
    id=request.args.get("userid")
    sql="select * from upmoney where userid="+id
    with db.cursor() as cursor:
        result=db.queAll(cursor,sql)
    return "商品名称：%s<br/>商品价格：%s"%(result[0]["name"],result[0]["money"])
if __name__=="__main__":
    app.run(debug=True)